@echo off
set zippath=%ProgramFiles%\winrar
cd /d %~dp0
cd QQ
set /a groupID=0
set /a imgNo=0
for %%F in (*.gif *.jpg) do call :fz %%F

for /L %%P in (0,1,9) do call :CreateZip %%P


PAUSE
goto :EOF

:fz

set /a imgNo=imgNo+1
if %imgNo%==50 set /a groupID=groupID+1 & set /a imgNo=0
md %groupID% 2>nul
move %1 %groupID%
rem echo %1
GOTO :EOF

:CreateZip
echo %1
if not EXIST %1 GOTO :EOF
"%zippath%\winrar.exe" a QQ%1.zip %1\*.*
GOTO :EOF
